package com.athuahua.spzx.exception;

import com.athuahua.spzx.utils.ResultCodeEnum;
import lombok.Data;

/**
 * @Author: huahua
 * @Date: 2024/7/21 0021
 * @Time: 12:51
 * @Description:
 */
@Data
public class CodeException extends RuntimeException{
    private Integer code;
    private String message;

    private ResultCodeEnum resultCodeEnum;

    public CodeException(ResultCodeEnum resultCodeEnum){
        this.resultCodeEnum = resultCodeEnum;
        this.code = resultCodeEnum.getCode();
        this.message = resultCodeEnum.getMessage();
    }
}
